package com.wtb.javatool.service.impl;


import com.wtb.javatool.dao.DishMapper;
import com.wtb.javatool.entity.Dish;
import com.wtb.javatool.service.IDishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class DishService implements IDishService {
	
	
	@Autowired
	private DishMapper dishMapper;
	
	/**
	 * 添加菜品
	 * @param dish
	 */
	public Integer save(Dish dish) {
		return dishMapper.save(dish);
	}

	/**
	 * 修改菜品
	 * @param dish
	 */
	public Integer update(Dish dish) {
		return dishMapper.update(dish);
	}
	/**
	 * 列出所有菜品
	 * @return
	 */
	public List<Dish> listAll(){
		return dishMapper.listAll();
	}
	/**
	 * 根据ID删除某个 菜品
	 * @return
	 */
	public Integer delete(Long id) {
		return dishMapper.delete(id);

	}
}
